package 曾世昌12_19.demo1;

import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;

public class Mainapp {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {
        Cat cat = new Cat();
        HashMap<String, Object> map = new HashMap<>();
        map.put( "name","xty" );
        map.put( "age",18 );
        map.put( "color","黑" );
        map.put( "sex","中" );
        BeanUtils.populate( cat,map );
        System.out.println(cat);
    }
}
